<template>
    <div>
        <div class="outmain ba_f">
            <div class="maintitle">积分设置</div>
            <el-form ref="form" :model="form" label-width="180px">
                <el-form-item label="积分名称自定义">
                    <el-input v-model="form.name"></el-input>
                </el-form-item>
                <el-form-item label="订单积分奖励" class="jfinput">
                    <div>
                        <el-radio v-model="form.resource" label="1">每单奖励
                            <el-input-number v-model="reward" controls-position="right" :min="0" :max="1000000"
                                             class="mar_l10"></el-input-number>
                            <span class="mar_l10">积分</span>
                        </el-radio>
                    </div>
                    <div class="mar_t10">
                        <el-radio v-model="form.resource" label="2">奖励订单实付金额的
                            <el-input-number v-model="rewardRatio" controls-position="right" :min="0" :max="1000000"
                                             class="mar_l10"></el-input-number>
                            <span class="mar_l10">%积分</span>
                        </el-radio>
                    </div>
                </el-form-item>
                <el-form-item label="订单评论奖励" class="jfinput">
                    <el-input-number v-model="comment" controls-position="right" :min="0"
                                     :max="1000000"></el-input-number>
                    <span class="mar_l10">积分</span>
                </el-form-item>
                <!--      <el-form-item label="积分规则">-->
                <!--        <el-radio-group v-model="form.resource">-->
                <!--          <el-radio label="1">按交易金额</el-radio>-->
                <!--          <el-radio label="2">按订单数</el-radio>-->
                <!--        </el-radio-group>-->
                <!--      </el-form-item>-->
                <!--      <el-form-item label="消费一元等于" v-if="form.resource=='1'">-->
                <!--        <el-input v-model="form.name">-->
                <!--          <template slot="append">积分</template>-->
                <!--        </el-input>-->
                <!--      </el-form-item>-->
                <!--      <el-form-item label="完成一单等于" v-if="form.resource=='2'">-->
                <!--        <el-input v-model="form.name">-->
                <!--          <template slot="append">积分</template>-->
                <!--        </el-input>-->
                <!--      </el-form-item>-->
            </el-form>
        </div>
        <div class="mar_t20 ba_f pad_20 t_c">
            <el-button type="primary" @click="onSubmit">保存</el-button>
        </div>
    </div>
</template>
<script>
    export default {
        data() {
            return {
                form: {
                    name: '',
                    region: '',
                    date1: '',
                    date2: '',
                    delivery: false,
                    type: [],
                    resource: '1',
                    desc: ''
                },
            }
        },
        methods: {}
    }
</script>
<style>
    .jfinput .el-form-item__content .el-input {
        width: 180px;
    }
</style>
